@using BTCPayServer.TagHelpers
@using Microsoft.AspNetCore.Html
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model BTCPayServer.Models.ServerViewModels.MaintenanceViewModel
@{
    ViewData.SetLayoutModel(new LayoutModel(nameof(ServerNavPages.Maintenance), StringLocalizer["Maintenance"])
        .SetCategory(WellKnownCategories.Server));
}

<div class="sticky-header">
	<h2 class="my-1">@ViewData["Title"]</h2>
</div>
<partial name="_StatusMessage" />

<form method="post">
    <div class="row mb-5">
        <div class="col-xl-8 col-xxl-constrain">
            <div class="form-group">
                <label asp-for="DNSDomain" class="form-label"></label>
                <input asp-for="DNSDomain" class="form-control" disabled="@(Model.CanUseSSH ? null : "disabled")" />
                <div class="form-text">@ViewLocalizer["You can change the domain name of your server by following {0}.", new HtmlString($"<a href=\"https://docs.btcpayserver.org/FAQ/Deployment/#how-to-change-your-btcpay-server-domain-name\" target=\"_blank\" rel=\"noreferrer noopener\">{StringLocalizer["this guide"]}</a>")]</div>
                <span asp-validation-for="DNSDomain" class="text-danger"></span>
            </div>
            <button name="command" type="submit" class="btn btn-secondary" value="changedomain" title="@StringLocalizer["Change domain"]" disabled="@(Model.CanUseSSH ? null : "disabled")">Change Domain</button>

            <h4 class="mt-5 mb-2" text-translate="true">Restart</h4>
            <p text-translate="true">Restart BTCPay Server and related services.</p>
            <div class="form-group">
                <div class="input-group">
                    <button name="command" type="submit" class="btn btn-secondary" value="restart" disabled="@(Model.CanUseSSH ? null : "disabled")" text-translate="true">Restart</button>
                </div>
            </div>

            <h4 class="mt-5 mb-2" text-translate="true">Clean</h4>
            <p text-translate="true">Delete unused Docker images present on your system.</p>
            <div class="form-group">
                <div class="input-group">
                    <button name="command" type="submit" class="btn btn-secondary" value="clean" disabled="@(Model.CanUseSSH ? null : "disabled")" text-translate="true">Clean</button>
                </div>
            </div>

            <h4 class="mt-5 mb-2" text-translate="true">Update</h4>
            <p text-translate="true">Update to the latest version of BTCPay Server.</p>
            <div class="form-group">
                <div class="input-group">
                    <button name="command" type="submit" class="btn btn-primary" value="update" disabled="@(Model.CanUseSSH ? null : "disabled")" text-translate="true">Update</button>
                </div>
            </div>
        </div>
    </div>
</form>

@section PageFootContent {
    <partial name="_ValidationScriptsPartial" />
}
